package com.biubiushop.entity;

import com.biubiushop.util.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Table;

import javax.persistence.Column;
import javax.persistence.Entity;

@Data
@EqualsAndHashCode(callSuper=true)
@Entity
@javax.persistence.Table(name = "equipment")
@Table(appliesTo = "equipment",comment = "设备表")
public class Equipment extends BaseEntity {
	
	private static final long serialVersionUID = 1L;

	@Column(nullable = false, columnDefinition = "varchar(32) comment '设备编号'")
	private String code;
	
	@Column(nullable = false, columnDefinition = "tinyint(1) comment '设备类型'")
	private Integer type;
	
	@Column(columnDefinition = "varchar(36) comment '设备所属区域代理'")
	private String areaAgent;
	
	@Column(columnDefinition = "varchar(36) comment '设备所属市级代理'")
	private String cityAgent;
	
	@Column(columnDefinition = "varchar(36) comment '业务员Id'")
	private String salesman;
	
	@Column(columnDefinition = "varchar(36) comment '合伙人Id'")
	private String partner;
	
	@Column(columnDefinition = "varchar(36) comment '商户Id'")
	private String merchant;

	@Column(nullable = false,columnDefinition = "varchar(128) comment '设备详细地址'")
	private String address;

	@Column(nullable = false,columnDefinition = "double(10,6) comment '设备坐标经度'")
	private Double longitude;
	
	@Column(nullable = false,columnDefinition = "double(10,6) comment '设备坐标纬度'")
	private Double latitude;
	
	@Column(nullable = false,columnDefinition = "bit(1) DEFAULT b'1' comment '是否启用(0-已使用(true),1-未使用(false))'")
	private Boolean isUse;
	
	@Column(nullable = false,columnDefinition = "bit(1) DEFAULT b'1' comment '设备是否正常(0-正常(true),1-异常(false))'")
	private Boolean isNormal;
	
	@Column(columnDefinition = "tinyint(4) comment '设备状态'")
	private Integer deviceStatus;

	@Column(nullable = false,columnDefinition = "int(11) comment '设备剩余纸巾长度(单位:厘米)'")
	private Integer overLength;

	@Column(columnDefinition = "varchar(50) comment '设备图片'")
	private String deviceImage;

	@Column(columnDefinition = "varchar(50) comment '设备通讯id'")
	private String socketId;
}
